Skip to content

feat(progress-bar): add recipe and tokens#31087

Open
thetaPC wants to merge 14 commits intoionic-modularfrom
FW-6857
Open

feat(progress-bar): add recipe and tokens#31087
thetaPC wants to merge 14 commits intoionic-modularfrom
FW-6857

Conversation

@thetaPC
Copy link
Copy Markdown
Contributor

@thetaPC thetaPC commented Apr 17, 2026

Issue number: internal


What is the current behavior?

Component styles for ion-progress-bar are fragmented across multiple files (native and ionic). The md and ios themes rely on the native styles. Developers were restricted to those themes and how those themes structured the logic and styles.

What is the new behavior?

  • Unified Style Architecture: Combined theme-specific styling into a single progress-bar.scss file that consumes CSS variables, ensuring a single source of truth for component logic.
  • Element-First Token Structure: Refactored the IonProgressBar type and tokens to use an element-first hierarchy ({type}.{element}.{state}, e.g., determinate.progress.default.background). This provides predictability and consistency with the rest of the system.
  • Defined TypeScript Interface: Added progress-bar.interfaces.ts with reusable types for the recipe and config.
  • Defined Theme Defaults: Added per-theme token defaults in ios, md, and ionic theme files.
  • Shape Support: Introduced round and rectangular shape variants with per-theme defaults (round for ios and ionic, rectangular for md).
  • Solid State Styling: Introduced dedicated styles for when the progress bar is fully buffered (buffer = 1), including separate rules for the buffer bar and buffer circles.
  • Type-Scoped CSS: Split generic buffer bar styles into type-specific selectors (progress-bar-type-determinate / progress-bar-type-indeterminate) to prevent cross-type style bleed.
  • Updated CSS Variables: Replaced --background and --progress-background with a structured set of semantic variables (e.g., --ion-progress-bar-determinate-progress-default-background).
  • Updated Tests: Added shape snapshot tests.

Does this introduce a breaking change?

  • Yes
  • No

This PR introduces breaking changes to how IonProgressBar is styled.

Migration Path:

  1. Token Updates: Update any custom theme configurations to match the new nested structure.

  2. CSS Variable Replacements: --background and --progress-background have been removed. Use the new token structure instead:

    • --backgroundIonProgressBar.determinate.buffer.bar.default.background (or the indeterminate equivalent)
    • --progress-backgroundIonProgressBar.determinate.progress.default.background (or the indeterminate equivalent)

If per-component customization is needed, the CSS variables can be used directly (e.g., --ion-progress-bar-determinate-progress-default-background).

  1. Host class names: The type classes on the host element have been renamed to include the prop name:

    • .progress-bar-determinate.progress-bar-type-determinate
    • .progress-bar-indeterminate.progress-bar-type-indeterminate
  2. Theme classes: Remove any instances that target the theme classes: ion-progress-bar.md, ion-progress-bar.ios.

Other information

Previews:
Previews:

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ionic-framework Ready Ready Preview, Comment Apr 20, 2026 6:22pm

Request Review

@github-actions github-actions bot added the package: core @ionic/core package label Apr 17, 2026
Comment thread core/src/utils/theme.ts
subtle?: boolean;
}

export function ionColor(name: string, variation: string, options: IonColorOptions = {}): string {
Copy link
Copy Markdown
Contributor Author

@thetaPC thetaPC Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is originally added through the badge PR but it's still in progress so I added it here to not be blocked.

@thetaPC thetaPC marked this pull request as ready for review April 20, 2026 22:21
@thetaPC thetaPC requested a review from a team as a code owner April 20, 2026 22:21
@thetaPC thetaPC requested a review from OS-jacobbell April 20, 2026 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: angular @ionic/angular package package: core @ionic/core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant